class stack:
    def __init__(self):
        self.data = []

    def push(self, item):
        self.data.append(item)

    def pop(self):
        return self.data.pop()

    def peek(self):
        return self.data[-1]

    def is_empty(self):
        return self.data == []

def reverse_number(n:int)->int:
    temp = str(n)
    temp_stack = stack()

    for i in temp:
        temp_stack.push(int(i))

    ret = []
    while not temp_stack.is_empty():
        ret.append(temp_stack.pop())

    str_ret = ""
    for i in ret:
        str_ret += str(i)

    return int(str_ret)

print(reverse_number(365))
print(reverse_number(13313))
print(reverse_number(10086545))



